function [position,isterminal,direction] = Y0Check(~,S)
GM_sun=1.327124400*10^(11);     %Sun
GM_earth=3.986004418*10^(5);    %Earth
GM_moon = 4.9048695*10^(3);     %Moon
%[km^3/s^2] Gravitational Parameters
u_se = GM_earth / (GM_earth+GM_sun);% se --> Sun-Earth system
% 
% position = 3.0000045907012-Jacobi; % The value that we want to be zero
position = S(2)-0.4; % The value that we want to be zero
isterminal = 1;  % Halt integration 
direction = 0;   % The zero can be approached from either direction